package cn.hh.jasypt.controller;

import cn.hh.jasypt.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Controller
@ResponseBody
@RequestMapping("info")
public class UserController {
    @Autowired
    private UserMapper userMapper;

    @GetMapping("/list")
    public Map<String,Object> list(){
        Map<String,Object> result = new HashMap<String,Object>();
        result.put("user",userMapper.selectList(null));
        return result;
    }
}
